import { getFldm } from '@/utils/get-fldm'
export const formItems = async (key: string) => {
  const obj: any = {
    dsp: [
      {
        disabled: false,
        label: '借阅单编号',
        prop: 'jydbh',
        type: 'input',
        placeholder: '请输入借阅单编号',
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '申请日期',
        prop: 'sqrq-rq',
        type: 'daterange',
        placeholderStart: '请选择开始日期',
        placeholderEnd: '请选择结束日期',
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '借阅人',
        prop: 'jyrxm',
        type: 'input',
        placeholder: '请输入借阅人',
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '档案所属院',
        prop: 'sjdwbms',
        type: 'treeSelectAll',
        showAll: true,
        multiple: true,
        checkStrictly: true,
        showCurrentButton: false,
        nodeKey: 'dwbm',
        isLeafNode: false,
        props: {
          children: 'children',
          label: 'dwmc',
        },
        placeholder: '请选择档案所属院',
        options: [],
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '档案类型',
        prop: 'jydalxdms',
        multiple: true,
        type: 'select',
        placeholder: '请选择档案类型',
        options: await getFldm('gd042'),
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '借阅类型',
        prop: 'jylxdm',
        type: 'select',
        placeholder: '请选择借阅类型',
        options: await getFldm('gd048'),
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '借阅方式',
        prop: 'jyfsdm',
        type: 'select',
        placeholder: '请选择借阅方式',
        options: await getFldm('gd043'),
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '借阅目的',
        prop: 'jymddm',
        type: 'select',
        placeholder: '请选择借阅目的',
        options: await getFldm('gd044'),
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '借阅明细',
        prop: 'jymx',
        type: 'input',
        placeholder: '请输入借阅明细',
        iswm: 'Y',
      },
    ],
  }

  return obj[key]
}
